{WebApp} fix the not recognized as a valid DateTime error#17260
Merged
BethanyZhou merged 4 commits intoAzure:mainfrom Mar 3, 2022
Merged
{WebApp} fix the not recognized as a valid DateTime error#17260BethanyZhou merged 4 commits intoAzure:mainfrom
BethanyZhou merged 4 commits intoAzure:mainfrom
Conversation
This conversion to localtime should fix the conversion issue due to localization format
Contributor
|
Hi @navba-MSFT, have you figure out the root cause of this issue? I would like to suggest you to fix this issue by |
Fix for the DateTime.Parse(s.Time) to address the localization issue and avoid the error String was not recognized as a valid DateTime
Contributor
|
Hi @navba-MSFT , a test case is failed, please have a look. [xUnit.net 00:01:00.29] Microsoft.Azure.Commands.Websites.Test.ScenarioTests.CertificatesTests.TestNewAzWebAppCertificateForSlot [FAIL] |
Contributor
|
/azp run azure-powershell - windows-powershell |
Contributor
|
Azure Pipelines successfully started running 1 pipeline(s). |
Contributor
|
/AZP RUN azure-powershell - security-tools |
Contributor
|
Azure Pipelines successfully started running 1 pipeline(s). |
BethanyZhou
approved these changes
Mar 1, 2022
Contributor
Author
|
@BethanyZhou Thanks for reviewing this. Could you merge this once you get a chance ? |
Contributor
|
/azp run azure-powershell - security-tools |
Contributor
|
Azure Pipelines successfully started running 1 pipeline(s). |
Contributor
|
Sure, I will merge it when the CI passed. @navba-MSFT |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This conversion to localtime should fix the conversion issue due to localization format
Description
Checklist
I have read the Submitting Changes section of
CONTRIBUTING.mdThe title of the PR is clear and informative
The appropriate
ChangeLog.mdfile(s) has been updated:ChangeLog.mdfile can be found atsrc/{{SERVICE}}/{{SERVICE}}/ChangeLog.md## Upcoming Releaseheader -- no new version header should be addedThe PR does not introduce breaking changes
If applicable, the changes made in the PR have proper test coverage
For public API changes to cmdlets:
More Info:
When running the cmdlet with non en-US (at least, in pl-PL culture) the cmdlet fails with example error:
String '01/24/2022 22:52:39' was not recognized as a valid DateTime.
Output of:
[system.threading.thread]::CurrentThread.CurrentCulture
LCID Name DisplayName
1045 pl-PL Polish (Poland)
Steps to reproduce:
[system.threading.thread]::CurrentThread.CurrentCulture = [System.Globalization.CultureInfo]::GetCultureInfo("pl-PL")
Get-AzWebAppSnapshot -ResourceGroupName $SourceRG -Name $WebAppName
This fails with the error: String '01/24/2022 22:52:39' was not recognized as a valid DateTime.